package edu.sctu.practice.class01.wulixia.month09_wlx.assign03.three;

/**
 * Created by wulixia on 2015/11/5.
 * （2）	创建Name类，表示人名，其中包含三个String类型的数据成员：firstName，middlName和lastName。
 * （5）	为了实现CloneableCircle类对象的深拷贝，Name类也应该实现Cloneable接口，并实现clone方法。
 */
class Name implements Cloneable {

    private String firstName;
    private String middlName;
    private String lastName;

    public Name(String f, String m, String l) {

        firstName = f;
        middlName = m;
        lastName = l;

    }
    public String getFullname() {

        String s = firstName + " " + middlName + " " + lastName;
        return s;
    }

    public void setFirstname(String s) {
        firstName = s;
    }

    public void setMi(String s) {
        middlName = s;
    }

    public void setLastName(String s) {
        lastName = s;
    }

    public Object clone() {

        Object o = null;

        try {
            o = (Name) super.clone();
        } catch (CloneNotSupportedException ex) {
            return null;
        }

        return o;
    }

}

